/**
 * Upper case first char
 * @param {String} string
 */
export default function asCamelize(string, upper = true) {
  // return string.replace(/[-_](\w)/g, function(_, word) {
  //   return word.substring(0, 1).toUpperCase() + word.substring(1)
  // })
  var word = string.replace(/[-_](\w)/g, (_, c) => (c ? c.toUpperCase() : ''))
  return upper ? word.substring(0, 1).toUpperCase() + word.substring(1) : word
}
